﻿using UnityEngine;
using System.Collections;
using System;

//[Serializable]
public class SomePerson : MonoBehaviour
{
    //This field gets serialized because it is public.
    //这个域被序列化因为他是公开的。
    public string name = "John";

    //This field does not get serialized because it is private.
    //这个域没有被序列化因为它是私有的。
    int age = 40;

    //This field gets serialized even though it is private
    //这个域被序列化尽管他是私有的。
    //because it has the SerializeField attribute applied.
    //因为它应用了SerializeField属性
    [SerializeField, HideInInspector]
    private bool hasHealthPotion = true;

    public int Age
    {
        get
        {
            return age;
        }

        set
        {
            age = value;
        }
    }

    public bool HasHealthPotion
    {
        get
        {
            return hasHealthPotion;
        }

        set
        {
            hasHealthPotion = value;
        }
    }

    void Update()
    {
    }
}